﻿<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Register.aspx.cs" Inherits="BestBuy.Account.Register" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div class="wrapper-content">
        <h2>
           Register account
        </h2>
        <div class="form-horizontal">
            <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="alert alert-danger"
                ValidationGroup="RegisterUserValidationGroup" />
            <fieldset>
                <legend>User information</legend>
                <div class="control-group">
                    <asp:Label ID="FirstNameLabel" runat="server" AssociatedControlID="FirstName" CssClass="control-label">FirstName:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="FirstName" runat="server" MaxLength="50" />
                        <asp:RequiredFieldValidator ID="FirstNameRequired" runat="server" ControlToValidate="FirstName"
                            CssClass="failureNotification" ErrorMessage="FirstName." ToolTip="FirstName." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>
                <div class="control-group">
                    <asp:Label ID="LastNameLabel" runat="server" AssociatedControlID="LastName" CssClass="control-label">LastName:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="LastName" runat="server" MaxLength="50" />
                        <asp:RequiredFieldValidator ID="LastNameRequired" runat="server" ControlToValidate="LastName"
                            CssClass="failureNotification" ErrorMessage="LastName." ToolTip="LastName." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>
                <div class="control-group">
                    <asp:Label ID="AccountTypeLabel" runat="server" CssClass="control-label">AccountType:</asp:Label>
                    <div class="controls">
                        <label class="radio">
                            <asp:RadioButton ID="BuyerAccountType" runat="server" GroupName="AccountType" Checked="true" />
                            Buyer
                        </label>
                        <label class="radio">
                            <asp:RadioButton ID="SellerAccountType" runat="server" GroupName="AccountType" />
                            Seller
                        </label>
                    </div>
                </div>
                <div class="control-group">
                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email" CssClass="control-label">E-mail:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                            CssClass="failureNotification" ErrorMessage="E-mail." ToolTip="E-mail."
                            ValidationGroup="RegisterUserValidationGroup" Display="Dynamic">*</asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="EmailValidValidator" runat="server" ControlToValidate="Email"
                            Display="Dynamic" CssClass="failureNotification" ErrorMessage="Invalid email address."
                            ToolTip="Invalid email address." ValidationGroup="RegisterUserValidationGroup"
                            ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                        <asp:CustomValidator ID="EmailExistedValidator" runat="server" CssClass="failureNotification"
                            ErrorMessage="Email address is already registered." ToolTip="Email address is already registered."
                            ValidationGroup="RegisterUserValidationGroup" OnServerValidate="EmailExistedValidator_ServerValidate">*</asp:CustomValidator>
                    </div>
                </div>
                <div class="control-group">
                    <asp:Label ID="PhoneNumberLabel" runat="server" AssociatedControlID="PhoneNumber"
                        CssClass="control-label">PhoneNumber:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="PhoneNumber" runat="server" MaxLength="20" />
                        <asp:RequiredFieldValidator ID="PhoneNumberRequired" runat="server" ControlToValidate="PhoneNumber"
                            CssClass="failureNotification" ErrorMessage="PhoneNumber." ToolTip="PhoneNumber."
                            ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>
            </fieldset>
            <fieldset>
                <legend>Information login</legend>
                <div class="control-group">
                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" CssClass="control-label">UserName:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                            CssClass="failureNotification" ErrorMessage="UserName." ToolTip="UserName."
                            ValidationGroup="RegisterUserValidationGroup" Display="Dynamic">*</asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="UsernameExistedValidator" runat="server" CssClass="failureNotification"
                            ErrorMessage="Username was used." ToolTip="Username was used."
                            ValidationGroup="RegisterUserValidationGroup" OnServerValidate="UsernameExistedValidator_ServerValidate">*</asp:CustomValidator>
                    </div>
                </div>
                <div class="control-group">
                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" CssClass="control-label">Password:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                            CssClass="failureNotification" ErrorMessage="Password." ToolTip="Password."
                            ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator></div>
                </div>
                <div class="control-group">
                    <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword"
                        CssClass="control-label">Confirm Password:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification"
                            Display="Dynamic" ErrorMessage="Confirm Password." ID="ConfirmPasswordRequired"
                            runat="server" ToolTip="Confirm Password." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                            ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic"
                            ErrorMessage="Confirm password does not match." ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator></div>
                </div>
            </fieldset>
            <div class="control-group">
                <div class="controls">
                    <asp:Button ID="CreateUserButton" runat="server" Text="Register" ValidationGroup="RegisterUserValidationGroup"
                        CssClass="btn btn-primary" OnClick="CreateUserButton_Click" />
                </div>
            </div>
        </div>
    </div>
</asp:Content>
